import axios from 'axios';

export default {
    install: function(Vue, options) {

        let service = {
            // 根据Code获取词语组字典
            GetWordDictByCode: (code) => {
                return axios.get(`/word/${code}/dict`);
            },

            // 获取指定Code的词语项
            GetWordByCode: (code) => {
                return axios.get(`/word/${code}`);
            },

            // 根据PriceType获取价格列表
            GetPricesByType: (type) => {
                return axios.get(`/price/type/${type}`);
            },

            // 获取所有评委
            GetJuries: () => {
                return axios.post('/admin/jury/query?pageIndex=0&pageSize=0');
            },

            // 获取所有比赛场地
            GetRooms: () => {
                return axios.post('/admin/room/query?pageIndex=0&pageSize=0');
            }
        }

        Vue.prototype.$DataService = service;
    }
}